﻿#!/bin/sh
cat .ZLONG
cat /var/log/nginx/access.log | grep "last.crx" | awk '{print $1}' | sort | uniq -c | awk '{sum+=1} END {print "下载IP数:\t",sum}'
cat /var/log/nginx/access.log | awk '{print $1}' | sort | uniq -c | awk '{sum+=1} END {print "访问IP数:\t",sum}'
cat /var/log/nginx/access.log | grep "last.crx" | awk '{print $1}' | sort | uniq -c | awk '{sum+=$0} END {print "下载总数:\t",sum}'
cat /var/log/nginx/access.log | grep "history.aspx" | awk '{print $1}' | sort | uniq -c | awk '{sum+=$0} END {print "查询总数:\t",sum}'
cat /var/log/nginx/access.log | awk '{print $1}' | sort | uniq -c | awk '{sum+=$0} END {print "访问总数:\t",sum}'
echo -e "\n各个IP访问情况："
cat /var/log/nginx/access.log | awk '{print $1}' | sort | uniq -c | sort  -nr| head -n 10
echo -e "\n最近访问IP："
tail -n 100 /var/log/nginx/access.log | awk '{print $1}' | uniq -c | tail -n 8
echo -e "\n最近访问内容："
tail -n 5 /var/log/nginx/access.log |awk '{print "       ",$1,"\t",$7 }'|cut -d"?" -f1